package com.xh.chat.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * 忽略或者通过 好友请求的枚举
 */
@Getter
@AllArgsConstructor
public enum OperatorFriendRequestTypeEnum {

    IGNORE(0, "忽略"),
    PASS(1, "通过"),
    DEFAULT(99, "");

    private final Integer type;
    private final String msg;

    public static String getMsgByType(Integer type) {
        return Stream.of(values())
                .filter(item -> item.getType().equals(type))
                .findFirst().orElse(DEFAULT).getMsg();
    }

}
